/*    */ package com.zimbra.cs.redolog;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.Server;
/*    */ import com.zimbra.cs.util.Zimbra;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public abstract class RedoLogProvider
/*    */ {
/* 34 */   private static RedoLogProvider theInstance = null;
/*    */   protected RedoLogManager mRedoLogManager;
/*    */   
/*    */   static {
/* 38 */     try { theInstance = loadProvider();
/*    */     } catch (ServiceException e) {
/* 40 */       Zimbra.halt("Unable to initialize redolog provider", e);
/*    */     }
/*    */   }
/*    */   
/*    */   public static RedoLogProvider getInstance() {
/* 45 */     return theInstance;
/*    */   }
/*    */   
/*    */   private static RedoLogProvider loadProvider() throws ServiceException
/*    */   {
/* 50 */     RedoLogProvider provider = null;
/* 51 */     Class providerClass = null;
/* 52 */     Server config = Provisioning.getInstance().getLocalServer();
/* 53 */     String className = config.getAttr("zimbraRedoLogProvider");
/*    */     try {
/* 55 */       if (className != null) {
/* 56 */         providerClass = Class.forName(className);
/*    */       } else {
/* 58 */         providerClass = DefaultRedoLogProvider.class;
/* 59 */         ZimbraLog.misc.debug("Redolog provider name not specified.  Using default " + providerClass.getName());
/*    */       }
/*    */       
/* 62 */       provider = (RedoLogProvider)providerClass.newInstance();
/*    */     } catch (OutOfMemoryError e) {
/* 64 */       Zimbra.halt("out of memory", e);
/*    */     } catch (Throwable e) {
/* 66 */       throw ServiceException.FAILURE("Unable to load redolog provider " + className, e);
/*    */     }
/* 68 */     return provider;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   public RedoLogManager getRedoLogManager()
/*    */   {
/* 81 */     return this.mRedoLogManager;
/*    */   }
/*    */   
/*    */   public abstract boolean isMaster();
/*    */   
/*    */   public abstract boolean isSlave();
/*    */   
/*    */   public abstract void startup()
/*    */     throws ServiceException;
/*    */   
/*    */   public abstract void shutdown()
/*    */     throws ServiceException;
/*    */   
/*    */   public abstract void initRedoLogManager();
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/RedoLogProvider.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */